
<?php
	include("connect/connect.php");
	$stt = $_GET['stt'];
?>
<script>
function do_disable()
{
document.form1.xeploai.disabled="true";
}
function doenable2($trangthai)
{
	if($trangthai =='dau')
	{
	document.form1.xeploai.disabled = false;
	}else
	{
	document.form1.xeploai.disabled = true;
	}
}
</script>
<body onload="do_disable()">
<form method="POST" action=# id="form1" name="form1">
Điểm thi:<input type="text" name="diemthi" id="diemthi">
<br>
Kết quả:<select name="ketqua" id="ketqua"onchange="doenable2(this.value)">
	<option value='dau' >Đậu</option>
	<option value='rot' selected>Rớt</option>
</select><br>
Xếp loại:<select name="xeploai" id="xeploai">
	<option value="tb">Trung binh</option>
	<option value="kha">Khá</option>
	<option value="gioi">Giỏi</option>
</select><br>
<input type=submit>	
</form>
<?php
$stt = $_GET['stt'];
$diemthi = $_POST['diemthi'];
$ketqua = $_POST['ketqua'];
$xeploai = $_POST['xeploai'];

if ($diemthi !="")
	{
		
		$a = "UPDATE tbl_thuphieu SET diemthi = '{$diemthi}' WHERE f_maphieu = {$stt} ";
		$b = "UPDATE tbl_thuphieu SET xeploai = '{$xeploai}' WHERE f_maphieu = {$stt} ";
		$c = "UPDATE tbl_thuphieu SET ketqua = '{$ketqua}' WHERE f_maphieu = {$stt} ";		
	
		if((mysql_query($a)) and (mysql_query($b)) and (mysql_query($c)) )
		echo 'Thanh cong';
		else 
		echo 'Khong thanh cong';
	}

?>
</body>